package it.diego.projecttwo;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class HandlingButton extends Activity  implements OnClickListener {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.handling_button);
        
        View Button = findViewById(R.id.button);
		Button.setOnClickListener(this);
		
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.handling_button, menu);
        return true;
    }
    
    @Override
    public void onClick(View v) {
    	switch (v.getId()) 
		{
			case R.id.button:
				openNewGameDialog();
				break;
				
			case R.id.cambiaTutorial:
			{
				startActivity(new Intent(this, DragAndDropActivity.class));
				break;
			}
		}
    }

	private void openNewGameDialog() {
		new AlertDialog.Builder(this)
				.setTitle(R.string.button_label)
				.setItems(R.array.buttonarray,
						new DialogInterface.OnClickListener() {
							public void onClick(
									DialogInterface dialoginterface, int i) {
								
							}
						}).show();
	}
}
